public class ReflectTest {

    public static void main(String[] args) {
        /*try {
            Class<?> person = Class.forName("Person");

            System.out.println("-----------");

            person.newInstance();

            System.out.println("-----------");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }*/


        try {
            Class<?> person = ReflectTest.class.getClassLoader().loadClass("Person");

            System.out.println("----------");

            person.newInstance();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }
    }

}
